export let dayAnd_Time = (time) => {

    let now = new Date(
        Date.parse(new Date()) - Date.parse(new Date(time)));

    switch (now) {
        case ((now.getFullYear() - 1972 > 0) ? now : -1):
            time = `${now.getFullYear()} 年前`;
            break;
        case ((now.getMonth() > 0) ? now : -1):
            time = `${now.getMonth()} 月前`;
            break;
        case ((now.getDate() > 0) ? now : -1):
            time = `${now.getDate()} 天前`;
            break;
        case ((now.getHours() > 0) ? now : -1):
            time = `${now.getHours()} 小时前`;
            break;
        case ((now.getMinutes() > 0) ? now : -1):
            time = `${now.getMinutes()} 分钟前`;
            break;
        case ((now.getSeconds() > 0) ? now : -1):
            time = `${now.getSeconds()} 秒前`;
            break;
    }

    return time;
}

export let DateTime = (time) => {
    return new Date(parseInt(time) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ").replace(/(上午|下午)/g, '')
}